package com.paad.todolist;

import java.text.SimpleDateFormat;
import java.util.Date;

public class ShoppinglistItem {

  Integer id = null; 
  Date lastOrdered;
  String name;
  //Boolean done;
  ShoppinglistsDBAdapter shoppinglistDBAdapter;
  
  public Integer getId() {
	return id;
  }
  
  public String getName() {
    return name;
  }
  
  public void setId(int _id){
	  id = _id;
  }
  
  public Date getLastOrdered()
  {
	  return lastOrdered;
  }
  
  /*public Boolean getDone() {
    return done;    
  }*/
  
  public ShoppinglistItem(Integer _id, String _name, long _date) {
	id = _id;
	name = _name;
	lastOrdered = new Date(_date);
    //done = _done;
  }
  
  public ShoppinglistItem(String _name) {
		name = _name;
		lastOrdered = new Date(java.lang.System.currentTimeMillis());
	    //done = _done;
	  }

  /*public ShoppinglistItem(String _name, ShoppinglistsDBAdapter b) {
	  shoppinglistDBAdapter = b;
    id = (int) shoppinglistDBAdapter.insertShoppinglist(_name);
    name = _name;
    //done = false;
  }*/
  
  /*public void setDone(Boolean is_done) {
	shoppinglistDBAdapter.setDone(id, is_done);
	done = is_done;
  }*/
  
  @Override
  public String toString() {
    return id.toString() + ":" + name + ":";// + done.toString(); 
  }
}